-- lost_light
-- created by zhuangsl
-- 失明术

return {
    fetchProps = function(who, status, condition)
        local props = {};
        local propId = PropM.getPropId("reduce_attrib");
        local value = tonumber(condition["value"]);
        local endRound = condition["end_round"];

        if value > 0 then
            table.insert(props, { propId, "accuracy", value, endRound, });
        end

        -- 不看守格子
        propId = PropM.getPropId("lost_light");
        table.insert(props, { propId, 1, 1, endRound, });

        return props;
    end,

    desc = function(who, status, condition)
        -- 获取状态描述
        local cfg = CombatStatusM.getStatusInfo(status);
        local desc = cfg.desc;

        -- 效果,百分比
        local value = condition["value"];
        value = math.modf(value / 10);
        desc = string.gsub(desc, "{value}", value);

        return desc;
    end,

    fireEvent = function(target)
        -- 抛出事件
        EventMgr.fire(event.GRID_LOCK_STATE, {["pos"] = target:getPos(), });
    end
};
